package com.hengpeng.itfinoss.util;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.hengpeng.common.persist.entity.AbstractEntity;

/**
 * <pre>
 * 把List列表转换成Map
 * </pre>
 * @author chenjian
 * @version 1.0, 2011-1-4
 */
public class BeanConverter
{
	public static <T extends AbstractEntity> Map<Object, T> converter(List<T> list)
	{
		Map<Object, T> map = new HashMap<Object, T>();
		if (list == null)
			return map;
		for (T t : list)
		{
			map.put(t.getId(), t);
		}
		return map;
	}
}
